
namespace GeneticAlgorithms.Alphabets
{
    /// <summary>
    /// Base interface for all alphabets.
    /// </summary>
    /// <typeparam name="TGene">The type of the gene.</typeparam>
    public interface IAlphabet<TGene>
    {
        /// <summary>
        /// Gets the numeric range for the alphabet.
        /// </summary>
        /// <value>The total number of different values genes 
        /// in this alphabet may have.</value>
        /// <remarks>
        /// This property is used for random gene generation.
        /// </remarks>
        int Range { get; }

        /// <summary>
        /// Converts from an int into a gene value.
        /// </summary>
        /// <param name="value">The numeric value to be converted.</param>
        /// <returns>
        /// A gene that corresponds to the numeric value.
        /// </returns>
        TGene ConvertFromInt(int value);
    }
}
